//需要拦截器的地方使用instance对象， 有自定义返回逻辑的地方沿用axios，在组件内部处理返回结果即可
import request from '/@/utils/request';

export default function () {
    /**
     * 分页查询
     * @param params 要传的参数值
     * @returns 返回接口数据
     */
    const queryRecord = (params: object) => {
        return request({
            url: "/SysApi/Delivery/ToucherProductPlanDaily/QueryPage",
            method: "post",
            data: params,
        });
    };

    /**
     * 新增
     * @param params 要传的参数值
     * @returns 返回接口数据
     */
    const addPost = (params: object) => {
        return request({
            url: "/SysApi/Delivery/ToucherProductPlanDaily/Add",
            method: "post",
            data: params,
        });
    };

    /**
    * 更新 
    * @param params 要传的参数值
    * @returns 返回接口数据
    */
    const editPost = (params: object) => {
        return request({
            url: "/SysApi/Delivery/ToucherProductPlanDaily/Edit",
            method: "post",
            data: params,
        });
    };

     /**
    * 更新 
    * @param params 要传的参数值
    * @returns 返回接口数据
    */
     const batchEdit = (params: object) => {
        return request({
            url: "/SysApi/Delivery/ToucherProductPlanDaily/BatchEdit",
            method: "post",
            data: params,
        });
    };

    /**
    * 删除
    * @param params 要传的参数值
    * @returns 返回接口数据
    */
    const deletePost = (params: object) => {
        return request({
            url: "/SysApi/Delivery/ToucherProductPlanDaily/Delete",
            method: "post",
            data: params,
        });
    };

     /** 
     * 更新状态
     * @param params 要传的参数值
     * @returns 返回接口数据
     */
     const setStatusPost = (params: object) => {
        return request({
            url: "/SysApi/Delivery/ToucherProductPlanDaily/SetStatus",
            method: "post",
            data: params,
        });
    };


    return {
        queryRecord,
        addPost,
        editPost,
        setStatusPost,
        deletePost,
        batchEdit
    };
}
